home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / codelib2 / v_02_11 / 2n11056a < prev    next >
Encoding:
Text File  |  1995-11-01  |  429 b   |  14 lines

  1.  
  2. Listing 1.  SCASB Method of Finding Terminator Zero
  3.  
  4.   string    DB    "This is a string",0
  5.   .....
  6.   cld                     ; clear direction
  7.   mov   cx,0ffffh         ; set counter
  8.   mov   di,offset string  ; load offset
  9.   mov   al,0              ; load comparison value
  10.   repnz scasb             ; find the zero
  11.   not   cx                ; take ones complement
  12.   dec   cx                ; adjust length
  13.   .....
  14.